package com.atlanta.adopt;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.concurrent.ExecutionException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.protocol.HttpContext;

import com.atlanta.adopt.Globals.campus;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

public class AdoptatlantaActivity extends Activity implements View.OnClickListener {
    /** Called when the activity is first created. */
    private String URL = "http://sms.petpoint.com/webservices/adoptablesearch/wsAdoptableAnimals.aspx?location=HM-Adoption&stage=Available&species=Dog&sex=A&agegroup=All&onhold=A&orderby=ID&colnum=3&authkey=uj36rnuzp324mmby22csi3mbfbt4y4p1h38ahympi8f5h6vyto&css=http://www.atlantahumane.org/css/pets.css";
    // ^^ css stylesheet put in a url
    private Document doc ;
    // document object
    
    Button buttonHowellCats;
    Button buttonHowellDogs;
    Button buttonMansellCats;
    Button buttonMansellDogs;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // initialize
        setContentView(R.layout.splash);
        
        buttonHowellCats = (Button)findViewById(R.id.howell_cats);
        buttonHowellDogs = (Button)findViewById(R.id.howell_dogs);
        buttonMansellCats = (Button)findViewById(R.id.mansell_cats);
        buttonMansellDogs = (Button)findViewById(R.id.mansell_dogs);
        
        buttonHowellCats.setOnClickListener(this);
        buttonHowellDogs.setOnClickListener(this);
        buttonMansellCats.setOnClickListener(this);
        buttonMansellDogs.setOnClickListener(this);
    }

	public void onClick(View v) {
		if(v == this.buttonHowellDogs) {
			Intent dogIntent = new Intent(this,HMBrowserActivity.class);  
			((Globals)this.getApplication()).kennelAnimalsDisplayPageLink = "http://sms.petpoint.com/webservices/adoptablesearch/wsAdoptableAnimals.aspx?location=HM-Adoption&stage=Available&species=Dog&sex=A&agegroup=All&onhold=A&orderby=ID&colnum=3&authkey=uj36rnuzp324mmby22csi3mbfbt4y4p1h38ahympi8f5h6vyto&css=http://www.atlantahumane.org/css/pets.css";
			((Globals)this.getApplication()).kennelAnimalsDisplayPageTitle = "Howell Mill - Dogs";
			((Globals)this.getApplication()).type = campus.HOWELL_MILL;
		    startActivity(dogIntent); 
		    
		}else if(v==this.buttonHowellCats){
			Intent catIntent = new Intent(this,HMBrowserActivity.class);  
			((Globals)this.getApplication()).kennelAnimalsDisplayPageLink = "http://www.petango.com/webservices/adoptablesearch/wsAdoptableAnimals.aspx?location=HM-Adoption&stage=Available&species=Cat&sex=A&agegroup=All&onhold=A&orderby=ID&colnum=3&authkey=uj36rnuzp324mmby22csi3mbfbt4y4p1h38ahympi8f5h6vyto&css=http://www.atlantahumane.org/css/pets.css";
			((Globals)this.getApplication()).kennelAnimalsDisplayPageTitle = "Howell Mill - Cats";
			((Globals)this.getApplication()).type = campus.HOWELL_MILL;
		    startActivity(catIntent); 
		    
		}else if(v==this.buttonMansellDogs){
			Intent intent = new Intent(this,HMBrowserActivity.class);
			((Globals)this.getApplication()).kennelAnimalsDisplayPageLink =  "http://www.petango.com/webservices/adoptablesearch/wsAdoptableAnimals.aspx?location=MC-Adoption&stage=Available&species=Dog&sex=A&agegroup=All&onhold=A&orderby=ID&colnum=3&authkey=uj36rnuzp324mmby22csi3mbfbt4y4p1h38ahympi8f5h6vyto&css=http://www.atlantahumane.org/css/pets.css"; 
			((Globals)this.getApplication()).kennelAnimalsDisplayPageTitle = "Mansell - Dogs";
			((Globals)this.getApplication()).type = campus.MANSELL;
		    startActivity(intent); 
		}else if(v==this.buttonMansellCats){
			Intent intent = new Intent(this,HMBrowserActivity.class);
			((Globals)this.getApplication()).kennelAnimalsDisplayPageLink = "http://www.petango.com/webservices/adoptablesearch/wsAdoptableAnimals.aspx?location=MC-Adoption&stage=Available&species=Cat&sex=A&agegroup=All&onhold=A&orderby=ID&colnum=3&authkey=uj36rnuzp324mmby22csi3mbfbt4y4p1h38ahympi8f5h6vyto&css=http://www.atlantahumane.org/css/pets.css"; 
			((Globals)this.getApplication()).kennelAnimalsDisplayPageTitle = "Mansell - Cats";
			((Globals)this.getApplication()).type = campus.MANSELL;
		    startActivity(intent); 
		}
	}
    
}